/**
 * Copyright (c) 2010, iDA MediaFoundry
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * - Neither the name of iDA MediaFoundry nor the names of its contributors may
 *   be used to endorse or promote products derived from this software without
 *   specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package avmplus
{
	import flash.utils.describeType;

	[ExcludeClass]
	/**
	 * @private
	 * @author Jan Van Coppenolle
	 * @author Roland Zwaga
	 */
	public final class DescribeType
	{
		public static const HIDE_NSURI_METHODS:uint = avmplus.HIDE_NSURI_METHODS;
		public static const INCLUDE_BASES:uint = avmplus.INCLUDE_BASES;
		public static const INCLUDE_INTERFACES:uint = avmplus.INCLUDE_INTERFACES;
		public static const INCLUDE_VARIABLES:uint = avmplus.INCLUDE_VARIABLES;
		public static const INCLUDE_ACCESSORS:uint = avmplus.INCLUDE_ACCESSORS;
		public static const INCLUDE_METHODS:uint = avmplus.INCLUDE_METHODS;
		public static const INCLUDE_METADATA:uint = avmplus.INCLUDE_METADATA;
		public static const INCLUDE_CONSTRUCTOR:uint = avmplus.INCLUDE_CONSTRUCTOR;
		public static const INCLUDE_TRAITS:uint = avmplus.INCLUDE_TRAITS;
		public static const USE_ITRAITS:uint = avmplus.USE_ITRAITS;
		public static const HIDE_OBJECT:uint = avmplus.HIDE_OBJECT;
		public static const FLASH10_FLAGS:uint = avmplus.FLASH10_FLAGS;
		
		public static const ACCESSOR_FLAGS:uint = INCLUDE_TRAITS | INCLUDE_ACCESSORS;
		public static const INTERFACE_FLAGS:uint = INCLUDE_TRAITS | INCLUDE_INTERFACES;
		public static const METHOD_FLAGS:uint = INCLUDE_TRAITS | INCLUDE_METHODS;
		public static const VARIABLE_FLAGS:uint = INCLUDE_TRAITS | INCLUDE_VARIABLES;
		
		public static const INSTANCE_INFO:uint = INCLUDE_BASES | INCLUDE_INTERFACES | INCLUDE_VARIABLES | INCLUDE_ACCESSORS | INCLUDE_METHODS | INCLUDE_METADATA | INCLUDE_CONSTRUCTOR | INCLUDE_TRAITS | USE_ITRAITS;
		public static const CLASS_INFO:uint = INCLUDE_INTERFACES | INCLUDE_VARIABLES | INCLUDE_ACCESSORS | INCLUDE_METHODS | INCLUDE_METADATA | INCLUDE_TRAITS | HIDE_OBJECT;

		public static function JSON(o:*, flags:uint):Object
		{
			try 
			{
				return describeTypeJSON(o, flags);
			} 
			catch (e:*) 
			{
			}
			
			return flash.utils.describeType(o);
		}
			
		public function DescribeType()
		{
			throw new Error("Static Class");
		}
	}
}